/**
 * Computer Network, Programming Assignment #2
 * 
 * Utility Class
 * 
 * @author Yancheng Li
 *
 */

public class PSPUtil {

	public static char[] convert2Char(byte[] data){
		char[] charData = new char[data.length];
		for(int i = 0; i < data.length; i++)
			charData[i] = (char)data[i];
			
		return charData;
	}
	
	public static byte[] convert2Byte(char[] data){
		byte[] byteData = new byte[data.length];
		for(int i = 0; i < data.length; i++)
			byteData[i] = (byte)data[i];
			
		return byteData;
	}
	public static void print(String string, boolean print){
		if(!print)
			return;
		
		System.out.println(string + "\n");
		System.out.print(">>");
	}
}
